Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent lambda IAM policies from detaching when orders are swapped #630

Closed

Conversation

tammyisaninja
Copy link

Description

Used for loop instead of count for resource "aws_iam_role_policy_attachment" "additional_many" to ensure that changing orders of the policy will not detach them

Motivation and Context

Fixes #629

I have a project on production where I used the module and added the policies to the lambda.

Subsequently, I swapped the order of the policies and they got detached from the lambda, this caused a production issue as the lambda lacked permissions. Would like to ensure that this does not happen again.

Breaking Changes

None that I am aware of

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
    There is no need to update as it applies to existing config

  • I have tested and validated these changes using one or more of the provided examples/* projects

  • I have executed pre-commit run -a on my pull request

image - terraform validate hook could not execute

I have also tested again the local code in the issue

Copy link

github-actions bot commented Dec 8, 2024

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added the stale label Dec 8, 2024
Copy link

This PR was automatically closed because of stale in 10 days

@github-actions github-actions bot closed this Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lambda IAM Policies Detaching from created IAM Role when Input Order is Changed
2 participants